﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 南宁WMS : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "T_Action",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    ActionCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ActionName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Icon = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    Method = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CssClassName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Action", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Areas",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    IsRealArea = table.Column<bool>(type: "bit", nullable: true),
                    WhId = table.Column<long>(type: "bigint", nullable: true),
                    WhCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    TypeId = table.Column<int>(type: "int", nullable: false),
                    TypeName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BuiltArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    ShelfCount = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Areas", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_BarCodeRule",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Type = table.Column<int>(type: "int", nullable: false),
                    RuleDescription = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BarCodeRules = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MaxNumber = table.Column<int>(type: "int", nullable: true),
                    Sample = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    NumberLength = table.Column<int>(type: "int", nullable: true),
                    StartNumber = table.Column<int>(type: "int", nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    IsEnable = table.Column<bool>(type: "bit", nullable: true),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_BarCodeRule", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_BindPickingPosition",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    PickingPositionId = table.Column<long>(type: "bigint", nullable: true),
                    PickingPositonName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    PickingPositionCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    NowLoginUserId = table.Column<long>(type: "bigint", nullable: true),
                    NowLoginUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_BindPickingPosition", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Cell",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CellType = table.Column<int>(type: "int", nullable: false),
                    WhId = table.Column<long>(type: "bigint", nullable: true),
                    WhCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    AreaId = table.Column<long>(type: "bigint", nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    RoutewayId = table.Column<long>(type: "bigint", nullable: true),
                    ShelfId = table.Column<long>(type: "bigint", nullable: true),
                    ShelfCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ShelfName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    LineNo = table.Column<int>(type: "int", nullable: false),
                    LayerNo = table.Column<int>(type: "int", nullable: false),
                    ColumnNo = table.Column<int>(type: "int", nullable: false),
                    DepthIndex = table.Column<int>(type: "int", nullable: false),
                    IsMaxDepth = table.Column<bool>(type: "bit", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BusinessType = table.Column<int>(type: "int", nullable: false),
                    IsLock = table.Column<bool>(type: "bit", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    FullStatus = table.Column<int>(type: "int", nullable: false),
                    DistanceValue = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    LogicalPartCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogicalPartName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HeightType = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Cell", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Customer",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    TypeId = table.Column<long>(type: "bigint", nullable: false),
                    TypeName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ResponsiblePerson = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Tel = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MobilePhone = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    Email = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    Shortname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Postcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Customer", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Department",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    DepartmentCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DepartmentName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ParentId = table.Column<long>(type: "bigint", nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Department", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Device",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    DeviceType = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: true),
                    ExceptionMsg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExceptionDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Device", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_DictItem",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    TypeId = table.Column<long>(type: "bigint", nullable: false),
                    ItemName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ItemCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ItemValue = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ParentId = table.Column<long>(type: "bigint", nullable: true),
                    LevelIndex = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    IsEnd = table.Column<bool>(type: "bit", nullable: true),
                    TypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDefault = table.Column<bool>(type: "bit", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_DictItem", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_DictType",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    TypeCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    IsTree = table.Column<bool>(type: "bit", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_DictType", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_ErrorLog",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Type = table.Column<int>(type: "int", nullable: true),
                    RequestUrl = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    RequestBody = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Response = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ErrorExcetionMsg = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Ip = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    HostName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_ErrorLog", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_FacilityTwin",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    taskCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    taskType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    StackerTag = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    startPoint = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    endPoint = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    currentPoint = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_FacilityTwin", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Instruct",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    WarehouseCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    StackingStorageId = table.Column<long>(type: "bigint", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    InstructType = table.Column<int>(type: "int", nullable: false),
                    WorkDeviceType = table.Column<int>(type: "int", nullable: true),
                    Action = table.Column<int>(type: "int", nullable: true),
                    Priority = table.Column<int>(type: "int", nullable: false),
                    FromLocation = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ExpectedToLocation = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ToLocation = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    FinishedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ScanedBarcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    InstructIndex = table.Column<int>(type: "int", nullable: false),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsSendSuccess = table.Column<bool>(type: "bit", nullable: true),
                    RelatedOrderId = table.Column<long>(type: "bigint", nullable: true),
                    RelatedOrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    DeviceCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    FromRoutewayId = table.Column<int>(type: "int", nullable: true),
                    BusinessType = table.Column<int>(type: "int", nullable: false),
                    BusinessGroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    RefCellCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsSuspend = table.Column<bool>(type: "bit", nullable: true),
                    LogicalCellAddr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Instruct", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_InterfaceLog",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Url = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
                    CallWay = table.Column<int>(type: "int", nullable: true),
                    CallWayStr = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    InParam = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutParam = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CallMillisecond = table.Column<int>(type: "int", nullable: true),
                    ExecMillisecond = table.Column<int>(type: "int", nullable: true),
                    ExecDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    FinishedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ReExecTimes = table.Column<int>(type: "int", nullable: true),
                    RefTaskId = table.Column<int>(type: "int", nullable: true),
                    RefInstructId = table.Column<int>(type: "int", nullable: true),
                    ErrorMsg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExecBusinessCalss = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogType = table.Column<int>(type: "int", nullable: true),
                    Direction = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_InterfaceLog", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Inventory",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    AreaId = table.Column<long>(type: "bigint", nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    LocationId = table.Column<long>(type: "bigint", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    LocationDepth = table.Column<int>(type: "int", nullable: false),
                    LocationLineNo = table.Column<int>(type: "int", nullable: false),
                    LocationLayerNo = table.Column<int>(type: "int", nullable: false),
                    LocationColumnNo = table.Column<int>(type: "int", nullable: false),
                    LocationName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    LocationHeightType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    RelatedOrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    IsLock = table.Column<bool>(type: "bit", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: false),
                    AvailableQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    AllocateQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PutawayQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PickedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackQty = table.Column<int>(type: "int", nullable: true),
                    MaterialKeyId = table.Column<long>(type: "bigint", nullable: true),
                    InStockDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SupplierId = table.Column<long>(type: "bigint", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CustomerId = table.Column<long>(type: "bigint", nullable: true),
                    CustomerName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    MaterialTypeId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Qadate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ErplocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoutewayId = table.Column<long>(type: "bigint", nullable: true),
                    StackingStorageId = table.Column<long>(type: "bigint", nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BusinessType = table.Column<int>(type: "int", nullable: false),
                    LocationDistanceValue = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    LogicalPartCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RealHeightType = table.Column<int>(type: "int", nullable: true),
                    DisOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DisOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InStockShortDate = table.Column<int>(type: "int", nullable: true),
                    WoodPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true),
                    MultPalletId = table.Column<int>(type: "int", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    MaterialCategoryId = table.Column<int>(type: "int", nullable: true),
                    MaterialCategoryName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ParentPalletBarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InventoryAlert = table.Column<int>(type: "int", nullable: false),
                    WhetherQualified = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Inventory", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_InventoryDetail",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    InventoryId = table.Column<long>(type: "bigint", nullable: false),
                    Barcode = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    IsOut = table.Column<bool>(type: "bit", nullable: false),
                    SkuNum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    IsSku = table.Column<bool>(type: "bit", nullable: true),
                    BarcodeRange = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_InventoryDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Log",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", maxLength: 20, nullable: false),
                    LogType = table.Column<int>(type: "int", nullable: false),
                    ActionType = table.Column<int>(type: "int", nullable: true),
                    RecordType = table.Column<int>(type: "int", nullable: true),
                    RecordId = table.Column<int>(type: "int", nullable: true),
                    UserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    RealName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModuleName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Description = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Ipaddress = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    IpAddressName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UserId = table.Column<int>(type: "int", nullable: true),
                    UserRemark = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Log", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Material",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModelSpec = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    FullTypeIds = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    FullTypeNames = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    GrossWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NetWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    GrossWeightUnitId = table.Column<int>(type: "int", nullable: true),
                    GrossWeightUnitName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    NetWeightUnitId = table.Column<int>(type: "int", nullable: true),
                    NetWeightUnitName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Volum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    VolumUnitId = table.Column<int>(type: "int", nullable: true),
                    VolumUnitName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MinSafetyStock = table.Column<int>(type: "int", nullable: true),
                    MaxSafetyStock = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Img = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
                    MaterialCategoryId = table.Column<long>(type: "bigint", nullable: true),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: true),
                    MaterialGroupId = table.Column<long>(type: "bigint", nullable: true),
                    IsNeedCharging = table.Column<bool>(type: "bit", nullable: true),
                    ExpirationMonth = table.Column<int>(type: "int", nullable: true),
                    MaterialCategoryName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    IsDismantle = table.Column<bool>(type: "bit", nullable: true),
                    WarningDays = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Material", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_MaterialCategory",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ParentId = table.Column<long>(type: "bigint", nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true),
                    IsLeaf = table.Column<bool>(type: "bit", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_MaterialCategory", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_MaterialGroup",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Describe = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    AreaId = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_MaterialGroup", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_MaterialKey",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    SupplierId = table.Column<long>(type: "bigint", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Qadate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Mblnr = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Mjahr = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Zeile = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    ProOrderNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    OutOrderNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    PurchaseGrp = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    GroupName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    SerialnoParam = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    TestMark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_MaterialKey", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Menu",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    MenuName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    MenuUrl = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    MenuIcon = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true),
                    ParentId = table.Column<long>(type: "bigint", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    IsMobile = table.Column<bool>(type: "bit", nullable: false),
                    IsHide = table.Column<bool>(type: "bit", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Menu", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_MenuAction",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", maxLength: 20, nullable: false),
                    MenuId = table.Column<long>(type: "bigint", nullable: false),
                    ActionId = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_MenuAction", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Pallet",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    PalletBarcode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    PalletName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    Opprint = table.Column<int>(type: "int", nullable: false),
                    PrintTimes = table.Column<int>(type: "int", nullable: false),
                    LocationName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ErplocationName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Type = table.Column<int>(type: "int", nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    MaximumWeightOfTray = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    LoadFactor = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Pallet", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_PickingOrder",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", maxLength: 20, nullable: false),
                    Code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    RelatedOrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    LocationDepth = table.Column<int>(type: "int", nullable: true),
                    Roadway = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    StackingStorageId = table.Column<long>(type: "bigint", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    DescAddress = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    MaterialKeyId = table.Column<long>(type: "bigint", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_PickingOrder", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_PickingOrderDetail",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", maxLength: 20, nullable: false),
                    OrderId = table.Column<long>(type: "bigint", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    PackBarcode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialBarcode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_PickingOrderDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_PickingPosition",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    PickingPositionId = table.Column<long>(type: "bigint", nullable: true),
                    PickingPositionName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    PickingPositionCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_PickingPosition", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_PutawayOrder",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", maxLength: 20, nullable: false),
                    Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    RelatedOrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    StackingStorageId = table.Column<long>(type: "bigint", nullable: false),
                    PalletBarcode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    SiteCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Roadway = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    LocationDepth = table.Column<int>(type: "int", nullable: true),
                    Fifodate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    Volume = table.Column<int>(type: "int", nullable: true),
                    Weight = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreateUserId = table.Column<int>(type: "int", nullable: true),
                    CreateUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    MaterialKeyId = table.Column<long>(type: "bigint", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_PutawayOrder", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_PutawayOrderDetail",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", maxLength: 20, nullable: false),
                    PutawayOrderId = table.Column<long>(type: "bigint", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    MaterialBarcode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_PutawayOrderDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_ReceivingBill",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    BillNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    SupplierId = table.Column<long>(type: "bigint", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CustomerId = table.Column<long>(type: "bigint", nullable: true),
                    CustomerName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    BeginDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    RefSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Receiver = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TotalQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TotalCheckQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CheckedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    IsCreatedChecklist = table.Column<bool>(type: "bit", nullable: true),
                    CheckType = table.Column<int>(type: "int", nullable: true),
                    CheckResult = table.Column<int>(type: "int", nullable: true),
                    Ngreason = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_ReceivingBill", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_ReceivingBillDetail",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    BillId = table.Column<long>(type: "bigint", nullable: false),
                    BillNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BillLineNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", maxLength: 30, nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    ReceivedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    ConfirmDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PurchaseOrderNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SupplierId = table.Column<long>(type: "bigint", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CheckedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    NeedCheckQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    IsNeedQc = table.Column<bool>(type: "bit", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_ReceivingBillDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_ReceivingOrderDetail",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    OrderSn = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    WarehouseCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ReceivedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    StackedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PackagedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PackQty = table.Column<int>(type: "int", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    LocationId = table.Column<long>(type: "bigint", nullable: true),
                    LocationName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    LocationCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Qadate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SupplierId = table.Column<long>(type: "bigint", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CustomerId = table.Column<long>(type: "bigint", nullable: true),
                    CustomerName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    OutFactoryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    InStarDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialKeyId = table.Column<long>(type: "bigint", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    MaterialImg = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    LogicalPartCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    LogicalPartName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Mblnr = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    SubmitDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true),
                    SubmitUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditUserId = table.Column<int>(type: "int", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Mjahr = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Zeile = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    ProOrderNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    OutOrderNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    RefInVoucherId = table.Column<int>(type: "int", nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: true),
                    ReceivingBillDetailId = table.Column<long>(type: "bigint", nullable: true),
                    ReceivingBillId = table.Column<long>(type: "bigint", nullable: true),
                    TotalPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Price = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    BatchNoExplain = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_ReceivingOrderDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Role",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    RoleCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    RoleName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Role", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_RoleMenuAction",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", maxLength: 20, nullable: false),
                    RoleId = table.Column<long>(type: "bigint", nullable: false),
                    MenuId = table.Column<long>(type: "bigint", nullable: false),
                    ActionId = table.Column<long>(type: "bigint", nullable: true),
                    IsMobile = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_RoleMenuAction", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Routeway",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WhId = table.Column<long>(type: "bigint", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Routeway", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Shelf",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    WhId = table.Column<long>(type: "bigint", nullable: false),
                    AreaId = table.Column<long>(type: "bigint", nullable: false),
                    AreaCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CellCount = table.Column<int>(type: "int", nullable: true),
                    DisabledCellCount = table.Column<int>(type: "int", nullable: true),
                    Depth = table.Column<int>(type: "int", nullable: true),
                    ShelfType = table.Column<int>(type: "int", nullable: true),
                    RoutewayId = table.Column<long>(type: "bigint", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Shelf", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_ShippingLockCell",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    OrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    OrdeSn = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    InventoryId = table.Column<long>(type: "bigint", nullable: true),
                    CellId = table.Column<long>(type: "bigint", nullable: true),
                    CellCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CellName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WhId = table.Column<long>(type: "bigint", nullable: true),
                    StackingStorageId = table.Column<long>(type: "bigint", nullable: true),
                    OutQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    InventoryQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    LockIndex = table.Column<int>(type: "int", nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialKeyId = table.Column<long>(type: "bigint", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    IsPicking = table.Column<bool>(type: "bit", nullable: true),
                    RoutewayId = table.Column<long>(type: "bigint", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_ShippingLockCell", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_ShippingOrderDetail",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    OrderSn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Proirity = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    WarehouseCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: false),
                    MaterialCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialTypeCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    StationId = table.Column<long>(type: "bigint", nullable: true),
                    StationName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PackQty = table.Column<int>(type: "int", nullable: true),
                    PickedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ShippedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    FinshDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    SubmitUserId = table.Column<int>(type: "int", nullable: true),
                    SubmitUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SubmitDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AuditUserId = table.Column<int>(type: "int", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Mblnr = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Mjahr = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Zeile = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PurOrderNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PurOrderLineNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PurOrderLineType = table.Column<int>(type: "int", nullable: true),
                    ProOrderNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DeptCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DeptName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DisOrderNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DisOrderLineNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    RefOutVoucherId = table.Column<int>(type: "int", nullable: true),
                    RefDispatchOrderId = table.Column<int>(type: "int", nullable: true),
                    ContractNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    IsMultPallet = table.Column<bool>(type: "bit", nullable: true),
                    IsSuspend = table.Column<bool>(type: "bit", nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: true),
                    IsOutOrderReview = table.Column<bool>(type: "bit", nullable: true),
                    IsOnceOut = table.Column<bool>(type: "bit", nullable: true),
                    ProduceFactory = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    SupplierId = table.Column<long>(type: "bigint", nullable: true),
                    CustomerId = table.Column<long>(type: "bigint", nullable: true),
                    CustomerName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_ShippingOrderDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_StackingStorage",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    WarehouseCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    RelatedOrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    PalletBarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    SubTrayQty = table.Column<int>(type: "int", nullable: true),
                    PackQty = table.Column<int>(type: "int", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ExpectedLocation = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ActualLocation = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    TotalLength = table.Column<int>(type: "int", nullable: true),
                    TotalWidth = table.Column<int>(type: "int", nullable: true),
                    TotalHeight = table.Column<int>(type: "int", nullable: true),
                    TotalVolume = table.Column<int>(type: "int", nullable: true),
                    TotalWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Fifodate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Articlebarcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaterialKeyId = table.Column<long>(type: "bigint", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CacheLocation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    LogicalPartCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_StackingStorage", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Station",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DeviceCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WhId = table.Column<long>(type: "bigint", nullable: false),
                    WhCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WhName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaId = table.Column<long>(type: "bigint", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Ledid = table.Column<int>(type: "int", nullable: true),
                    StationSort = table.Column<int>(type: "int", nullable: false),
                    StationType = table.Column<int>(type: "int", nullable: false),
                    FunctionType = table.Column<int>(type: "int", nullable: false),
                    Status = table.Column<int>(type: "int", nullable: false),
                    IsLock = table.Column<bool>(type: "bit", nullable: true),
                    AddrFloor = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Station", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_StocktakeResultRecord",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    OrderId = table.Column<long>(type: "bigint", nullable: false),
                    OrderSn = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: false),
                    WarehouseName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaId = table.Column<long>(type: "bigint", nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BillTypeId = table.Column<int>(type: "int", nullable: true),
                    BillTypeName = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
                    CellId = table.Column<long>(type: "bigint", nullable: true),
                    CellCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true),
                    PackageBarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialBarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ScanBarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    OriginalQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CountQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    UnitId = table.Column<int>(type: "int", nullable: true),
                    UnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsHandle = table.Column<byte>(type: "tinyint", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_StocktakeResultRecord", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_StocktakingOrder",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Name = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    OrderSn = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: false),
                    WarehouseCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    WarehouseName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaId = table.Column<long>(type: "bigint", nullable: true),
                    AreaCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    PlanType = table.Column<int>(type: "int", nullable: false),
                    StocktakeWay = table.Column<int>(type: "int", nullable: false),
                    MaxLocationCount = table.Column<int>(type: "int", nullable: true),
                    Granularity = table.Column<int>(type: "int", nullable: true),
                    CellCount = table.Column<int>(type: "int", nullable: false),
                    FinishedCount = table.Column<int>(type: "int", nullable: false),
                    TouchTimes = table.Column<int>(type: "int", nullable: true),
                    TouchStartDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    TouchEndDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LoopTimes = table.Column<int>(type: "int", nullable: false),
                    PriorityLevel = table.Column<int>(type: "int", nullable: false),
                    ExecDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    SubmitDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SubmitUserId = table.Column<long>(type: "bigint", nullable: true),
                    SubmitUserName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AuditUserId = table.Column<long>(type: "bigint", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_StocktakingOrder", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_StocktakingOrderDetail",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    OrderDetailId = table.Column<long>(type: "bigint", nullable: true),
                    OrderSn = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CellId = table.Column<long>(type: "bigint", nullable: true),
                    CellCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    LocationName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CellDepthIndex = table.Column<int>(type: "int", nullable: true),
                    PalletBarcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ExpectedStationIds = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    HasSkuDetail = table.Column<bool>(type: "bit", nullable: true),
                    Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    QualityState = table.Column<int>(type: "int", nullable: true),
                    BatchNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProductDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SupplierId = table.Column<long>(type: "bigint", nullable: true),
                    SupplierName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialTypeId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialTypeName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Step = table.Column<int>(type: "int", nullable: true),
                    IsNeedMove = table.Column<bool>(type: "bit", nullable: true),
                    InventoryId = table.Column<long>(type: "bigint", nullable: true),
                    WarehouseId = table.Column<long>(type: "bigint", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_StocktakingOrderDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Supplier",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    TypeId = table.Column<long>(type: "bigint", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Contact = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ContactMobile = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Contact1 = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Contact1Mobile = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Email = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DisplayOrder = table.Column<int>(type: "int", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Supplier", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_TransferBinOrder",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    OrderSn = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BillType = table.Column<int>(type: "int", nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    SourceType = table.Column<int>(type: "int", nullable: true),
                    Proirity = table.Column<int>(type: "int", nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Reason = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    SubmitUserId = table.Column<long>(type: "bigint", nullable: true),
                    SubmitUserName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    SubmitDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AuditUserId = table.Column<long>(type: "bigint", nullable: true),
                    AuditUserName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AuditDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_TransferBinOrder", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_TransferBinOrderDetail",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    OrderId = table.Column<long>(type: "bigint", nullable: true),
                    OrderSn = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MaterialId = table.Column<long>(type: "bigint", nullable: true),
                    MaterialName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    FromWhId = table.Column<long>(type: "bigint", nullable: true),
                    FromWhName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    FromWhCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    FromRegionId = table.Column<long>(type: "bigint", nullable: true),
                    FromRegionName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    FromRegionCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    FromLocationId = table.Column<long>(type: "bigint", nullable: true),
                    FromLocationName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    FromLocationCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ToWhId = table.Column<long>(type: "bigint", nullable: true),
                    ToWhName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ToWhCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ToRegionId = table.Column<long>(type: "bigint", nullable: true),
                    ToRegionName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ToRegionCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ToLocationId = table.Column<long>(type: "bigint", nullable: true),
                    ToLocationName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ToLocationCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ExpectedStackingQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    ActualStackingQty = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Quantity = table.Column<int>(type: "int", nullable: true),
                    IsFullStackingProirity = table.Column<bool>(type: "bit", nullable: true),
                    ExceptionCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ExceptionText = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    FilterType = table.Column<int>(type: "int", nullable: true),
                    ToLogicalPartCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    IsPriorityFilling = table.Column<int>(type: "int", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_TransferBinOrderDetail", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_User",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    UserName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    RealName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Pwd = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    HeadShot = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: true),
                    Gender = table.Column<int>(type: "int", nullable: true),
                    MobilePhone = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    Email = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    JobNo = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    DepartmentId = table.Column<int>(type: "int", nullable: true),
                    IsSeeOnlySelfData = table.Column<bool>(type: "bit", nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_User", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_UserRole",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", maxLength: 20, nullable: false),
                    UserId = table.Column<long>(type: "bigint", nullable: false),
                    RoleId = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_UserRole", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Warehouse",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Name = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    TypeId = table.Column<int>(type: "int", nullable: true),
                    TypeName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Erpcode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Status = table.Column<int>(type: "int", nullable: false),
                    Contact = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    MobilePhone = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AddrDetail = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    BuiltArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    AreaCount = table.Column<int>(type: "int", nullable: true),
                    StationCount = table.Column<int>(type: "int", nullable: true),
                    RoutewayCount = table.Column<int>(type: "int", nullable: true),
                    IsMain = table.Column<bool>(type: "bit", nullable: true),
                    MapCode = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Warehouse", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_Action");

            migrationBuilder.DropTable(
                name: "T_Areas");

            migrationBuilder.DropTable(
                name: "T_BarCodeRule");

            migrationBuilder.DropTable(
                name: "T_BindPickingPosition");

            migrationBuilder.DropTable(
                name: "T_Cell");

            migrationBuilder.DropTable(
                name: "T_Customer");

            migrationBuilder.DropTable(
                name: "T_Department");

            migrationBuilder.DropTable(
                name: "T_Device");

            migrationBuilder.DropTable(
                name: "T_DictItem");

            migrationBuilder.DropTable(
                name: "T_DictType");

            migrationBuilder.DropTable(
                name: "T_ErrorLog");

            migrationBuilder.DropTable(
                name: "T_FacilityTwin");

            migrationBuilder.DropTable(
                name: "T_Instruct");

            migrationBuilder.DropTable(
                name: "T_InterfaceLog");

            migrationBuilder.DropTable(
                name: "T_Inventory");

            migrationBuilder.DropTable(
                name: "T_InventoryDetail");

            migrationBuilder.DropTable(
                name: "T_Log");

            migrationBuilder.DropTable(
                name: "T_Material");

            migrationBuilder.DropTable(
                name: "T_MaterialCategory");

            migrationBuilder.DropTable(
                name: "T_MaterialGroup");

            migrationBuilder.DropTable(
                name: "T_MaterialKey");

            migrationBuilder.DropTable(
                name: "T_Menu");

            migrationBuilder.DropTable(
                name: "T_MenuAction");

            migrationBuilder.DropTable(
                name: "T_Pallet");

            migrationBuilder.DropTable(
                name: "T_PickingOrder");

            migrationBuilder.DropTable(
                name: "T_PickingOrderDetail");

            migrationBuilder.DropTable(
                name: "T_PickingPosition");

            migrationBuilder.DropTable(
                name: "T_PutawayOrder");

            migrationBuilder.DropTable(
                name: "T_PutawayOrderDetail");

            migrationBuilder.DropTable(
                name: "T_ReceivingBill");

            migrationBuilder.DropTable(
                name: "T_ReceivingBillDetail");

            migrationBuilder.DropTable(
                name: "T_ReceivingOrderDetail");

            migrationBuilder.DropTable(
                name: "T_Role");

            migrationBuilder.DropTable(
                name: "T_RoleMenuAction");

            migrationBuilder.DropTable(
                name: "T_Routeway");

            migrationBuilder.DropTable(
                name: "T_Shelf");

            migrationBuilder.DropTable(
                name: "T_ShippingLockCell");

            migrationBuilder.DropTable(
                name: "T_ShippingOrderDetail");

            migrationBuilder.DropTable(
                name: "T_StackingStorage");

            migrationBuilder.DropTable(
                name: "T_Station");

            migrationBuilder.DropTable(
                name: "T_StocktakeResultRecord");

            migrationBuilder.DropTable(
                name: "T_StocktakingOrder");

            migrationBuilder.DropTable(
                name: "T_StocktakingOrderDetail");

            migrationBuilder.DropTable(
                name: "T_Supplier");

            migrationBuilder.DropTable(
                name: "T_TransferBinOrder");

            migrationBuilder.DropTable(
                name: "T_TransferBinOrderDetail");

            migrationBuilder.DropTable(
                name: "T_User");

            migrationBuilder.DropTable(
                name: "T_UserRole");

            migrationBuilder.DropTable(
                name: "T_Warehouse");
        }
    }
}
